package site.jlopen.mapper.job;

import java.util.List;

import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

//import site.jlopen.domain.job.KusciaJobTask;
//import site.jlopen.domain.job.event.KusciaJobTaskEvent;
import site.jlopen.dao.job.KusciaJobTaskDao;
import site.jlopen.entity.job.JobRunStatusVo;
import site.jlopen.entity.job.TaskLogVo;
import site.jlopen.secret.model.job.SecretJobTaskState;

/**
* @ClassName: KusciaJobTaskMapper
* @Description: KusciaJobTaskDao对应的Mapper继承类
* 由KusciaJobTaskDao提供基本的增删改查接口，其他业务接口在此实现即可
* @author 码农小鹿
* @date 2024-08-29
 */
@Mapper
public interface KusciaJobTaskMapper extends KusciaJobTaskDao {

	int clearTask(Long jobId);
    
    /** demo ext sql **/
    /** KusciaJobTaskEvent selectByInfo(KusciaJobTask info); **/
	
	List<JobRunStatusVo> selectTaskStatus(Long jobId);

	List<TaskLogVo> selectTaskLogs(@Param("projectId")Long projectId, @Param("flowId")Long flowId);
	
	int updateTaskStatus(@Param("projectId")Long projectId, @Param("flowId")Long flowId, @Param("nodeId")String nodeId, 
			@Param("status")String status, @Param("errMsg")String errMsg);
	
	int updateTaskStateById(@Param("taskId")String taskId, 
			@Param("status")String status, @Param("errMsg")String errMsg);

	List<SecretJobTaskState> selectTaskForApi(Long jobId);
}
